<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>El Corte Francés</title>
        <link href="./../CSS/Zara/cssZara.css" type="text/css" rel="stylesheet" />
    </h:head>
    <h:body>
       #{managedBeanProductos.cargarProducto()}
       
        <h:dataTable value="#{managedBeanProductos.lista}" var="lis">
            <h:column>
            <f:facet name="header">
                <h:outputText value="Imagen" />
            </f:facet>
                <h:form>
                    <h:graphicImage id="image" url="#{lis.imagen}" width="100"/>         
                </h:form>
            </h:column> 
            <h:column>
            <f:facet name="header">
                <h:outputText value="Nombre" />
            </f:facet>
                <h:form>
                    <p:inplace id="ajaxInplace" editor="true">  
                        <p:inputText value="#{lis.nombre}"  required="true" label="text"/>  
                    </p:inplace>  
                </h:form>
            </h:column> 
            <h:column>
            <f:facet name="header">
                <h:outputText value="Descripcion" />
            </f:facet>
                <h:form>
                    <p:inplace id="ajaxInplace" editor="true">  
                        <p:inputText value="#{lis.descripcion}"  required="true" label="text"/>  
                    </p:inplace>  
                </h:form>
            </h:column> 
            <h:column>
            <f:facet name="header">
                <h:outputText value="Stock" />
            </f:facet>
                <h:form>
                    <p:inplace id="ajaxInplace" editor="true">  
                        <p:inputText value="#{lis.stock}"  required="true" label="text"/>  
                    </p:inplace>  
                </h:form>
            </h:column> 
            <h:column>
            <f:facet name="header">
                <h:outputText value="Precio" />
            </f:facet>
                <h:form>
                    <p:inplace id="ajaxInplace" editor="true">  
                        <p:inputText value="#{lis.precio}"  required="true" label="text"/>  
                    </p:inplace>  
                </h:form>
            </h:column> 
        </h:dataTable>
        <h:form>
            <h:commandButton value="Guardar" action="#{managedBeanProductos.guardar()}" />
            <h:commandButton value="Eliminar" action="#{managedBeanProductos.eliminarProducto()}" />
            <h:commandButton value="Volver" action="volver" />
        </h:form>
    </h:body>
</html>

